home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / nannws35.zip / SPREAD.PRG < prev    next >
Text File  |  1989-03-01  |  905b  |  35 lines

  1. * Program: Spread.prg
  2. * Author:  Greg Lief
  3. * Version: Clipper Summer '87
  4. *
  5. * Copyright (c) 1988-89 Greg Lief.
  6. * Placed into Public Domain.
  7. *
  8. * Syntax:  Spread(<message>, <row>, [<delay>, <midpoint>])
  9. *
  10.  
  11. FUNCTION Spread
  12. PARAM msg, row, delay, mid
  13. * Initialize delay and midpoint if parameters not passed.
  14. delay = IF(PCOUNT() < 3, 8, delay)
  15. mid = IF(PCOUNT() < 4, 40, mid)
  16. PRIVATE mlen, mloop, msg2, xx
  17. * initialize memvar to hold temporary version of string
  18. msg2 = ''
  19. mlen = LEN(msg)
  20. FOR mloop = 1 TO INT(mlen/2)
  21.    * Add characters to temp string from front and
  22.    * back of actual string.
  23.    msg2 = SUBSTR(msg, 1, mloop) + ;
  24.           SUBSTR(msg, mlen + 1 - mloop, mloop)
  25.    @ row, mid-mloop SAY msg2
  26.    FOR xx = 1 TO delay
  27.    NEXT
  28. NEXT
  29. * Must redraw string if length was not an even number.
  30. IF mlen%2 = 1
  31.    @ row, mid-mloop SAY msg
  32. ENDIF
  33. RETURN('')
  34. * EOF: Spread.prg
  35.